package demo;

import java.math.BigDecimal;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: YKH
 * Date: 2023-03-12
 * Time: 20:35
 */
public class Main5 {
    public static void main(String[] args) {
        //二 八钟数据类型
        //1.int 2.byte 3.boolean 4.float 5.double 6.short 7.long 8.char
        //需要进行初始化
        int a = 10;
        System.out.println(a);

        short b = 20;
        System.out.println(b);

        //数值超过int范围后, 需要在后面+上L
        long c = 100_0000_0000L;
        System.out.println(c);

        //定义float需要在后面加上f, 因为浮点数默认为double类型
        float d = 10.8f;
        System.out.println(d);

        double e = 10.8;
        System.out.println(e);

        //使用单引号, 不能使用双引号
        char f = 'a';
        System.out.println(f);

        String g = "asf";
        System.out.println(g);

        BigDecimal n = new BigDecimal("10.222222222222");
        System.out.println(n);

        byte b5 = 10;
        System.out.println(b);
// byte型变量所能表示的范围：
        System.out.println(Byte.MIN_VALUE);
        System.out.println(Byte.MAX_VALUE);

        int a2 = 0xffffffff;
        System.out.printf("%x\n", a2 >>> 1);
    }
}
